package org.mte.sak.bsh;

import bsh.EvalError;
import bsh.Interpreter;

/**
 * BeanShell
 *
 * @author Marco Traversari
 * @version $Revision: 1.1 $ $Date: 2011-04-18 08:37:50 $
 */
public class BeanShell {

	 /**
	  * eval
	  * @param txt
	  * @return object
	  */
	 public static Object eval(String txt) throws EvalError {
	    return (new Interpreter()).eval(txt);
	 }

     /**
      * evalBoolean
      * @param txt
      * @return boolean
      * @throws EvalError
      */
     public static boolean evalBoolean(String txt) throws EvalError {
         return ((Boolean) eval(txt)).booleanValue();
     }
}
